using System;
using WindowsPhoneMVC.Navigation;
using WindowsPhoneMVC.Navigation.Interfaces;

namespace WindowsPhoneMVC.ActionResults
{
    public class RedirectResult : ActionResult, IHaveNavigationCompletedSteps
    {
        private readonly Action navigationAction;

        public RedirectResult(NavigationContext context, Action navigationAction) : base(context)
        {
            this.navigationAction = navigationAction;
        }

        protected override void ExecuteInternal()
        {
        }

        public void NavigationComplete()
        {
            navigationAction();
        }
    }
}